package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.MrqDictScore;
import com.dhcc.DRGsHosp.facade.dto.MrqDictScoreDTO;

public class MrqDictScoreAssembler {

	
	public static MrqDictScoreDTO toDTO(MrqDictScore mrqDictScore){
		if( mrqDictScore == null ){
			return null;
		}
		MrqDictScoreDTO mrqDictScoreDTO = new MrqDictScoreDTO();

		mrqDictScoreDTO.setScoreCode(mrqDictScore.getScoreCode());
		mrqDictScoreDTO.setScoreName(mrqDictScore.getScoreName());
		mrqDictScoreDTO.setScoreScore(mrqDictScore.getScoreScore());
		
		return mrqDictScoreDTO;
	}
	
	public static List<MrqDictScoreDTO>  toDTOs(Collection<MrqDictScore>  mrqDictScoreMore){
		if ( mrqDictScoreMore == null) {
			return null;
		}
		List<MrqDictScoreDTO> mdrdList = new ArrayList<MrqDictScoreDTO>();
		for (MrqDictScore mrqDictScore : mrqDictScoreMore) {
			mdrdList.add( toDTO(mrqDictScore) );
		}
		return mdrdList;		
	}
	
	public static MrqDictScore toEntity(MrqDictScoreDTO mrqDictScoreDTO){
		if( mrqDictScoreDTO == null ){
			return null;
		}
		MrqDictScore mrqDictScore = new MrqDictScore();

		mrqDictScore.setScoreCode(mrqDictScoreDTO.getScoreCode());
		mrqDictScore.setScoreName(mrqDictScoreDTO.getScoreName());
		mrqDictScore.setScoreScore(mrqDictScoreDTO.getScoreScore());
		
		return mrqDictScore;
	}
	
	public static List<MrqDictScore>  toEntities(Collection<MrqDictScoreDTO>  mrqDictScoreDTOMore){
		if ( mrqDictScoreDTOMore == null) {
			return null;
		}
		List<MrqDictScore> mdrList = new ArrayList<MrqDictScore>();
		for (MrqDictScoreDTO mrqDictScoreDTO : mrqDictScoreDTOMore) {
			mdrList.add( toEntity(mrqDictScoreDTO) );
		}
		return mdrList;		
	}
	
}
